//
//  CCAFHTTPSessionManager.h
//  request
//
//  Created by cjg on 2018/5/30.
//  Copyright © 2018年 chenjg. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>

typedef enum : NSUInteger {
    RequestTypeGet,
    RequestTypePost,
} RequestType;

@interface CCAFHTTPSessionManager : AFHTTPSessionManager


/**
 * 重载AFN请求方法
 * @param type type
 * @param URLString URLString
 * @param parameters parameters
 * @param uploadProgress uploadProgress
 * @param downloadProgress downloadProgress
 * @param success success
 * @param failure failure
 * @return 网络请求task
 */
- (NSURLSessionDataTask *)cc_ataTaskWithHTTPMethod:(RequestType)type
                                       URLString:(NSString *)URLString
                                      parameters:(id)parameters
                                  uploadProgress:(void (^)(NSProgress *uploadProgress)) uploadProgress
                                downloadProgress:(void (^)(NSProgress *downloadProgress)) downloadProgress
                                         success:(void (^)(NSURLSessionDataTask *, id))success
                                         failure:(void (^)(NSURLSessionDataTask *, NSError *))failure;

@end
